import { setData, getData } from '@/utils/ls'
const TOKENKEY = 'rabbit-token'
const user = {
  namespaced: true,
  state: () => ({
    token: getData(TOKENKEY) || ''
  }),
  mutations: {
    setToken (state, token) {
      // 1.存入vuex state
      state.token = token
      // 2. 本地存一份
      setData(TOKENKEY, token)
    }
  },
  actions: { },
  getters: { }
}

export default user
